#include <iostream>
#include <vector>

using namespace std;

static int func(vector<int>::iterator a, vector<int>::iterator b, int num) {
    if (num == 0)
        return 1;
    if (a == b)
        return 0;
    int s = 0;
    for (int i = 0; i * *a <= num; ++i)
        s += func(a + 1, b, num - i * *a);
    return s;
}

int main() {
    vector<int> v {1, 2, 5, 10, 20, 50, 100, 200};
    cout << func(v.begin(), v.end(), 200) << endl; // 73682
}